import fasttext

# 假设模型已经训练好并保存为model_filename.ftz
model = fasttext.load_model("models/td_dim32_b3.ftz")

# 模型的顺序
st = model.get_labels()

# 按字符排序
labels = [
    "__label__00", "__label__01", "__label__02", "__label__03",
    "__label__04", "__label__05", "__label__06", "__label__07",
    "__label__08", "__label__09", "__label__10", "__label__11",
    "__label__12", "__label__13", "__label__14", "__label__15"
]

labels_map = {
    "__label__00": "__label__一周计划",
    "__label__01": "__label__牛腱子肉",
    "__label__02": "__label__周一周三",
    "__label__03": "__label__周二周五",
    "__label__04": "__label__周六",
    "__label__05": "__label__红膏炝蟹",
    "__label__06": "__label__八宝鸭",
    "__label__07": "__label__开始做饭",
    "__label__08": "__label__设定闹钟",
    "__label__09": "__label__垃圾处理器",
    "__label__10": "__label__下水管疏通",
    "__label__11": "__label__天气",
    "__label__12": "__label__下水管除菌",
    "__label__13": "__label__卤牛肉",
    "__label__14": "__label__出水",
    "__label__15": "__label__水温"
}

new_idx_list = []
for idx, ori in enumerate(labels):
    new_idx = st.index(ori)
    ch = labels_map[st[idx]].replace("__label__", "")
    en = f"A{idx:03}"
    full = f"{{\"{en}\", \" {ch}\"}},"
    print(full)
